import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * 待支付的三方订单列表 需要支付后在回调接口中删除数据
 */
@Entity('biz_order_to_pay_list', { comment: '未支付的三方订单列表' })
export class BizOrderToPayListEntity extends BaseEntity {
  @Column({ comment: '客户id' })
  userId: number;

  @Column({
    comment: '订单类型 0-定金 1-尾款',
    type: 'tinyint',
    default: 0,
  })
  orderType: number;

  @Index()
  @Column({ comment: '订单编号', length: 100, nullable: false })
  orderNo: string;

  @Column({
    comment: '三方支付类型 0-微信 1-支付宝',
    type: 'tinyint',
    default: 0,
  })
  tType: number;

  @Index({ unique: true })
  @Column({ comment: '三方支付订单号', length: 100, nullable: false })
  tOrderNo: string;

  @Column({
    comment: '支付金额',
    type: 'decimal',
    precision: 18,
    scale: 2,
    default: 0,
  })
  price: number;

  @Column({ comment: '备注', default: '' })
  notes: string;
}
